package com.example.wcdb.dao;

import androidx.room.Dao;
import androidx.room.Query;

import com.example.wcdb.BaseDao;
import com.example.wcdb.entity.User;

import java.util.List;

@Dao
public interface UserDao extends BaseDao<User> {
    @Query("delete from t_user")
    int deleteAll();

    @Query("select userName from t_user")
    String[] selectAllUserNames();

    @Query("select max(userId) from t_user")
    long selectMaxId();

    @Query("select * from t_user")
    List<User> selectAll();

    @Query("select * from t_user where userId = :userId")
    User selectUserById(String userId);

    @Query("select * from t_user where userId in (:userIds)")
    List<User> selectUsersById(String... userIds);
}
